package se.sll.service.catalogue.common.exception;

import java.io.Serializable;

/**
 * <P>Use <code>BusinessLogicException</code> to signal violations to business rules or logical errors.
 * For example this can occur when trying to persist an already existing entity.
 * <P>The below example shows usage, e.g.:
 * <li>Time: t , Create Entity(ID=A) -> OK
 * <li>Time: t+1 , Create Entity(ID=A) -> throw <code>BusinessLogicException</code>
 * @author Jiri Uosukainen
 */
public class BusinessLogicException extends Exception implements Serializable{
//public class BusinessLogicException extends WebApplicationException{

    private static final long serialVersionUID = 1L;
    
    public BusinessLogicException() {
    }

    public BusinessLogicException(String message) {
        super(message);
    }

    public BusinessLogicException(String message, Throwable thrwbl) {
        super(message, thrwbl);
    }

    public BusinessLogicException(Throwable thrwbl) {
        super(thrwbl);
    }
    
    
//    public BusinessLogicException() {
//        super(Response.Status.PRECONDITION_FAILED);
//    }
//    
//    public BusinessLogicException(String message) {
//        super(Response.status(Response.Status.PRECONDITION_FAILED)
//                .entity(message).type(MediaType.TEXT_PLAIN).build());
//    }
}
